$(function () {
    // tabs数据
     var tabsData = [{
         "id": "topic",
         "url": "topic.html"
     },{
         "id": "video",
         "url": "video.html"
     },{
         "id": "contactme",
         "url": "contactme.html"
     }];
     // 遍历json数组，循环添加a标签click事件
     $(tabsData).each(function () {
         console.log(this.id + "---->" + this.url);
         $("a[href='#" + this.id + "']").bind('click', {
             id: this.id,
             url: this.url
         }, tabsHandler);
     });
     $("#blogLink").trigger("click")
 });
 function tabsHandler(event) {
     var data = event.data;
     showTabs(data.id, data.url);
     return false;   // 阻止默认a标签相应
 }
 
 /***
  * 激活tab选项卡并使用ajax异步加载内容
  * @param {object} tabsId
  * @param {object} url
  */
 function showTabs(tabsId, url) {
     $("a[href='#" + tabsId + "']").tab('show');
     var $tabContent = $('#' + tabsId);
     $tabContent.load(url);
 }